import React from 'react';
import {render} from 'react-dom'
import Immutable from 'immutable'
import './index.css';
import * as serviceWorker from './serviceWorker'
import RouterConfig from './router'
import {createStore, applyMiddleware} from 'redux'
import {Provider} from 'react-redux'
import {connectRouter, routerMiddleware, ConnectedRouter} from 'react-router-redux'
import {Route, BrowserRouter} from 'react-router-dom'
import {renderRoutes} from 'react-router-config';
import rootReducer from './reducers'
import axios from 'axios'
import axiosMiddleware from 'redux-axios-middleware'

const client = axios.create({
	responseType: 'json'
});
const store = createStore(rootReducer,applyMiddleware(axiosMiddleware(client)))

render(
	<Provider store={store}>
		<BrowserRouter>
			{renderRoutes(RouterConfig)}
		</BrowserRouter>
	</Provider>, document.getElementById('root')
)
serviceWorker.unregister();
